<!--#include file="adovbs.inc"-->
<%
dim adoUseClient
dim cdoSendUsingPort
dim cdoSendUsingMethod
dim cdoSMTPServer
dim cdoSMTPConnectionTimeout
dim cdoSMTPServerPort
dim SMTPESTERNO
adoUseClient = 3
cdoSendUsingPort = 2
cdoSendUsingMethod="http://schemas.microsoft.com/cdo/configuration/sendusing"
cdoSMTPServer="http://schemas.microsoft.com/cdo/configuration/smtpserver"
cdoSMTPConnectionTimeout="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
cdoSMTPServerPort="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
CONN_DB="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\_web2v2\oi_bif\bif.mdb"
'CONN_DB="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\_webAS3\bif20XX.it\db\bif.mdb"

RC_X_PAGINA=10
'SMTPESTERNO = "mail.sianet.biz"
SMTPESTERNO = "10.1.10.2"





'----------------funzioni comuni
function wr0(str)
	response.write str
	response.end
end function
function wr1(str)
	response.write str & "<br>"
end function

'----restituisce un rs disconnesso----
function rsSQL(strSql,strConn)
	set connessione = Server.CreateObject("ADODB.Connection")
	connessione.open(strConn)
	set rs =server.CreateObject("ADODB.Recordset")
	rs.cursorlocation=3
	rs.open strSql, connessione
	set rs.activeconnection=nothing
	set rsSQL=rs
	connessione.close
	set connessione=nothing	
	set rs=nothing
end function

'---esegue una singola sql------
sub eseguiSQL(strSql, strConn)
	set connessione = Server.CreateObject("ADODB.Connection")
	connessione.open(strConn)
	connessione.execute(strSql)
	connessione.close
	set connessione=nothing
end sub		

'-----------------------------------------------------*
' crea_SelectGen
' autore:	Stefano
' data:		02/09/02
' input: 	rsElenco con tre campi - etichetta (eti), valore (val), flgSelezionato (sel)
'			nome
'			evento e funzione
' output: 	stringa HTML con select 
'-----------------------------------------------------*

function crea_selectGen(byref rsElenco, nome, funz, vuoto)
	dim str
	str = "<select  class='inputFlat'  name='"&nome&"' class='campoSel' "&funz&">"
	if vuoto=true then
		str = str & "<option></option>"
	end if
	while not rsElenco.eof
		str = str & "<option value='"&rsElenco("val")&"' "
		if rsElenco("sel") then 
			str = str & "selected" 
		end if
		str = str & ">" & rsElenco("eti") & "</option>"
		rsElenco.movenext
	wend
	str = str & "</select>"
	rsElenco.movefirst
	crea_selectGen = str
end function

'-----------------------------------------------------*
' crea_SelectOpt
' autore:	Stefano
' data:		01/10/03
' input: 	rsElenco con tre campi - etichetta (eti), valore (val), flgSelezionato (sel)
'			nome
'			evento e funzione
' output: 	stringa HTML con select 
'-----------------------------------------------------*

function crea_selectOpt(byref rsElenco, nome, funz, vuoto)
	dim str
	if vuoto=true then
		str = str & "<option></option>"
	end if
	while not rsElenco.eof
		str = str & "<option value='"&rsElenco("val")&"' "
		if rsElenco("sel") then 
			str = str & "selected" 
		end if
		str = str & ">" & rsElenco("eti") & "</option>"
		rsElenco.movenext
	wend
	str = str & "</select>"
	rsElenco.movefirst
	crea_selectOpt = str
end function

function rap(str)
	if isnull(str) then
		rap=""
	else
		rap=replace(str,"'","''")
	end if	
end function
'---------------------------
' min
'--------------------------
function min(a,b)
	if a<b then 
		min=a
	else
		min=b
	end if
end function
'---------------------------
'
'
'----------------------------
function wrline(str,ncar)
	wrline=""
	while len(str)>ncar
		wrline=wrline & left(str,ncar)&"<br>"
		str=mid(str,ncar+1)
	wend
	wrline=wrline & str
end function
%>
